<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <style>
        .a{
            width: 20px;
            height: 20px;
            background-color:#111;
        }
        .b{
            width: 40px;
            height: 40px;
            background-color:#666;

        }
        .c{
            width: 60px;
            height: 60px;
            background-color:#aaa;

        }
    </style>

</head>

<body>
  <div class="c">
    <div class="b">
      <div class="a">

      </div>
    </div>
  </div>

  <div class="c">
    <div class="b">
      <div class="a">

      </div>
    </div>
  </div>

  <script>
    $(`.a`).each(function () {
      $(this).click(function () {
        console.log($(this).parent().parent());
      })
    })
  </script>
</body>

</html>